package icloud.com.myapplication.ui.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import icloud.com.myapplication.R;

/**
 * 创建人：jinfangxing
 * 创建时间：2018/4/8
 * 功能描述：
 */

public class TestAdapter extends BaseAdapter {


    @Override
    public int getCount() {
        return 10;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        ViewHolder holder;
        if (view != null) {
            holder = (ViewHolder) view.getTag();
        } else {
            view = LayoutInflater.from(view.getContext()).inflate(R.layout.item_adapter, parent, 
                    false);
            holder = new ViewHolder(view);
            view.setTag(holder);
        }
        return view;
    }

    static class ViewHolder {
        @BindView(R.id.text_view)
        TextView mTextView;
        @BindView(R.id.button)
        Button mButton;
        ;

        public ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

}
